textview: properly remove anchored widgets
authorChristian Hergert <chergert@redhat.com>
Wed, 5 Aug 2020 21:08:07 +0000 (14:08 -0700)
committerChristian Hergert <chergert@redhat.com>
Wed, 5 Aug 2020 21:08:07 +0000 (14:08 -0700)
Fixes #3021

gtk/gtktextview.c

index 7a53f2d0299f403db18540205cfbd33719a8c94b..806635b6203d4cf31e565efea7def4bc9d546e40 100644 (file)
@@ -2053,7 +2053,7 @@ gtk_text_view_set_buffer (GtkTextView   *text_view,
       while (priv->anchored_children.length)
         {
           AnchoredChild *ac = g_queue_peek_head (&priv->anchored_children);
-          gtk_widget_unparent (ac->widget);
+          gtk_text_view_remove (text_view, ac->widget);
           /* ac is now invalid! */
         }